import i18n from '@/i18n'
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'
import { MetaTemplateBelong } from '@prisma/client'

export class MetaTemplate {
  static ApiPropertyEnum = {
    MetaTemplateBelong: [
      i18n.t('app-meta.model.meta-template.1215083-0', { args: [MetaTemplateBelong.System] }),
      i18n.t('app-meta.model.meta-template.1215083-1', { args: [MetaTemplateBelong.Platform] }),
    ],
  }

  @ApiProperty({ description: 'ID', type: Number })
  id: number

  @ApiProperty({ description: i18n.t('app-meta.model.meta-template.1215083-2'), type: String })
  label: string

  @ApiPropertyOptional({ description: i18n.t('app-meta.model.meta-template.1215083-3'), type: String })
  content?: string

  @ApiProperty({
    description: i18n.t('app-meta.model.meta-template.1215083-4'),
    enum: MetaTemplate.ApiPropertyEnum.MetaTemplateBelong,
  })
  belong: MetaTemplateBelong

  @ApiProperty({ description: i18n.t('app-meta.model.meta-template.1215083-5'), type: Date })
  createTime: Date

  @ApiProperty({ description: i18n.t('app-meta.model.meta-template.1215083-6'), type: String })
  platform: string

  @ApiPropertyOptional({ description: i18n.t('app-meta.model.meta-template.1215083-7'), type: String })
  project?: string

  @ApiProperty({ description: i18n.t('app-meta.model.meta-template.1215083-8'), type: String })
  groupLabel: string

  @ApiPropertyOptional({ description: i18n.t('app-meta.model.meta-template.1215083-9'), type: String })
  thumbnail?: string

  @ApiPropertyOptional({ description: i18n.t('app-meta.model.meta-template.1215083-10'), type: Number })
  sortNo?: number
}
